﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;

public partial class Student_Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        img.Visible = false;
    }

    protected void btnModifyPassword_Click(object sender, EventArgs e)
    {
        string oldpass = oldPassword.Text;
        string newpass = newPassword.Text;

        StudentManager manager = new StudentManager();

        msg.Text = oldpass + " " + newpass + " " + (String)Session["id"];
        
        if (manager.ModifyPassword((String)Session["id"], oldpass, newpass))
        {
            img.Visible = true;
            msg.Text = "修改成功！";
            img.ImageUrl = "../Image/accept.png";
        }
        else
        {
            img.Visible = true;
            msg.Text = "修改失败！";
            img.ImageUrl = "../Image/cross.png";
        }
       

    }
}
